package eu.codlab.androidemu;

import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import eu.codlab.androidemu.gbcdroid.FileChooserAdapter;
import eu.codlab.androidemu.gbcdroid.ListListener;
import eu.codlab.androidemu.origbc.FileSelectedListener;
import eu.codlab.androidemu.utilities.Game;
import eu.codlab.androidemu.utilities.ZipRead;
import eu.codlab.src.game.R;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;

/**
 * This class represents functions to help the user to
 * parse his gba folder to play with his favorite games
 * @author codlab
 *
 */
public class ActivitiesHelperGBA extends ActivitiesHelperSpecific{

	public ActivitiesHelperGBA(){

	}
	public ActivitiesHelperGBA(Activity activity, FileSelectedListener file_selected_listener){
		_list_int = R.id.gba;
		_type = Game.GBA;
		File gbc = new File(Environment.getExternalStorageDirectory(), "roms");
		gbc.mkdir();
		gbc = new File(gbc, "gba");
		gbc.mkdir();
		File nomedia = new File(gbc,".nomedia");
		if(!nomedia.exists())
			try {
				nomedia.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}

		_activity = activity;
		_file_selected_listener=file_selected_listener;


		filters = getFileFilter();
		currentDir = getDirectoryFromFile(gbc.getAbsolutePath());
		changeTo(currentDir);
	}

	public String[] getFileFilter() {
		return new String[]{"gba","zip"};
	}
}
